package Fourthwork;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Fruit {
	String name;
	
	
	@Override
	public String toString() {
		return "Fruit [name=" + name + "]";
	}
	public Fruit(String name) {
		super();
		this.name = name;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Fruit other = (Fruit) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equalsIgnoreCase(other.name))
			return false;
		return true;
	}
	public static void main(String[] args) {
		ArrayList<Fruit> list=new ArrayList<Fruit>();
		Scanner scan=new Scanner(System.in);		
		while(scan.hasNext()){
			String s=scan.nextLine();
			if(s.equals("end"))
				break;
			Fruit f=new Fruit(s);
			if(!list.contains(f)){
				list.add(f);
			}
		}
		System.out.println(list.toString());
		scan.close();
//        Fruit a=new Fruit("banana");
//        Fruit b=new Fruit("BANANA");
//        Fruit c=new Fruit("banananana");
//        System.out.println(a.name+" "+b.name+" "+a.equals(b));
//        System.out.println(a.name+" "+c.name+" "+a.equals(c));
        
	}
}
